package com.ex.model;
// Generated 2018-7-14 23:34:36 by Hibernate Tools 4.3.5.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TInstitute generated by hbm2java
 */
@Entity
@Table(name = "t_institute", catalog = "huaqiao")
public class TInstitute implements java.io.Serializable {

	private Integer id;
	private String name;
	private String code;
	private Date modifiedTime;
	private Integer modifiedBy;
	private Set TMajors = new HashSet(0);

	public TInstitute() {
	}

	public TInstitute(String name, String code) {
		this.name = name;
		this.code = code;
	}

	public TInstitute(String name, String code, Date modifiedTime, Integer modifiedBy, Set TMajors) {
		this.name = name;
		this.code = code;
		this.modifiedTime = modifiedTime;
		this.modifiedBy = modifiedBy;
		this.TMajors = TMajors;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "code", nullable = false, length = 30)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "modified_time", length = 19)
	public Date getModifiedTime() {
		return this.modifiedTime;
	}

	public void setModifiedTime(Date modifiedTime) {
		this.modifiedTime = modifiedTime;
	}

	@Column(name = "modified_by")
	public Integer getModifiedBy() {
		return this.modifiedBy;
	}

	public void setModifiedBy(Integer modifiedBy) {
		this.modifiedBy = modifiedBy;
	}

	@OneToMany(targetEntity=TMajor.class,fetch = FetchType.LAZY, mappedBy = "TInstitute")
	public Set getTMajors() {
		return this.TMajors;
	}

	public void setTMajors(Set TMajors) {
		this.TMajors = TMajors;
	}

}
